#include "../DataModule.h"

#define NUM_ITEMS	254

struct Item {
  char name[26];
  uchar type;
  uchar special[4]; // strengh, extra power, ep increase, special
  uint cost, effect, descAddress;
  bool canUse[4]; // Determines which characters can use the item
  bool isTransformable;	// if the item is in the Item Transformation Table
  bool canGive;
  bool unknown;
  bool infinite; // Infinite-use item
};

class ItemModule: public DataModule {
  private:
    Item items[NUM_ITEMS]; // char, name
    int getTypeName(int type);
  public:
    const char* getName();
    const char* getCredits();

    void readFromRom(Rom& rom);
    void writeToRom(Rom& rom);
    void readFromDat(char* dirName, std::map<std::string, std::string> &fns, std::map<std::string, int> &labels);
    void writeToDat(char* dirName, std::map<std::string, std::string> &fns);
};
